package com.voice.core.entity;

import com.alibaba.fastjson.JSONObject;

import java.util.HashMap;

public class HttpHeader extends HashMap {

    public HttpHeader() {
        super();
    }

    @Override
    public String toString() {
        return JSONObject.toJSONString(this);
    }

    public <T> T get(Object key, Class<T> tClass) {
        return (T) super.get(key);
    }

    public boolean contains(Object key) {
        return super.containsKey(key);
    }

    public String path() {
        return this.get("path", String.class);
    }

    public void path(String path) {
        this.put("path", path);
    }

    public int code() {
        return this.get("code", Integer.class);
    }

    public String message() {
        return this.get("message", String.class);
    }

    public void code(int code) {
        this.put("code", code);
    }

    public void message(String message) {
        this.put("message", message);
    }

}
